package com.yykj.hospital.server.model.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yykj.common.util.serializer.LocalDate2LongSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * Created by chendg
 * on 2021/10/31 0031.
 */
@Entity
@Data
public class HospitalLabel {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    @ApiModelProperty("医院ID")
    private Integer hospitalId;

    @ApiModelProperty("标签名称")
    @Column(length = 100,nullable = false)
    private String name;

    @ApiModelProperty("排序")
    private Integer sorting;

    @CreationTimestamp
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    private LocalDateTime addTime;

    @UpdateTimestamp
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    private LocalDateTime modifyTime;

}
